/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.f1x.api.message.fields;

// Generated by org.f1x.tools.DictionaryGenerator from QuickFIX dictionary
public enum ExecPriceType implements org.f1x.api.message.types.ByteEnum {
	BID_PRICE((byte)'B'),
	CREATION_PRICE((byte)'C'),
	CREATION_PRICE_PLUS_ADJUSTMENT_PERCENT((byte)'D'),
	CREATION_PRICE_PLUS_ADJUSTMENT_AMOUNT((byte)'E'),
	OFFER_PRICE((byte)'O'),
	OFFER_PRICE_MINUS_ADJUSTMENT_PERCENT((byte)'P'),
	OFFER_PRICE_MINUS_ADJUSTMENT_AMOUNT((byte)'Q'),
	SINGLE_PRICE((byte)'S');

	private final byte code;

	ExecPriceType (byte code) {
		this.code  = code;
	}

	public byte getCode() { return code; }

	public static ExecPriceType parse(String s) {
		switch(s) {
			case "B" : return BID_PRICE;
			case "C" : return CREATION_PRICE;
			case "D" : return CREATION_PRICE_PLUS_ADJUSTMENT_PERCENT;
			case "E" : return CREATION_PRICE_PLUS_ADJUSTMENT_AMOUNT;
			case "O" : return OFFER_PRICE;
			case "P" : return OFFER_PRICE_MINUS_ADJUSTMENT_PERCENT;
			case "Q" : return OFFER_PRICE_MINUS_ADJUSTMENT_AMOUNT;
			case "S" : return SINGLE_PRICE;
		}
		return null;
	}

}